import 'package:logger/logger.dart';
import 'dart:developer';

class CompatConsoleOutput extends LogOutput {
  @override
  void output(OutputEvent event) {
    for (var element in event.lines) {
      log(element.toString());
      // printWrapped(element.toString());
    }
  }

  void printWrapped(String text) {
    final pattern = RegExp('.{1,800}'); // 800 is the size of each chunk
    pattern.allMatches(text).forEach((match) => text);
  }
}
